package com.winchain.chainbill.bill.biz.send.rx;

import com.shell.framework.rx.OnErrorNotImplementedSubscriber;
import com.winchain.chainbill.bill.biz.Bill;
import com.winchain.chainbill.bill.biz.BillEvent;
import com.winchain.chainbill.bill.biz.send.service.BillOptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class BillOptSubscriber extends OnErrorNotImplementedSubscriber<BillEvent<? extends Object>> {
	@Autowired
	private BillOptService billOptService;

	public void onApplicationEvent(BillEvent<? extends Object> t) {
		this.billOptService.operate(t.getBill().getRec(), t.getOperation());
	}
}
